all:  bin/program
bin/pkg.o: src/pkg.h src/pkg.cpp src/big_int.h src/residue_math.h src/util.h
	g++ -c src/pkg.cpp -o bin/pkg.o
bin/residue_math.o: src/residue_math.h src/residue_math.cpp  src/big_int.h
	g++ -c src/residue_math.cpp -o bin/residue_math.o
bin/sha1.o: src/sha1.h src/sha1.cpp
	g++ -c src/sha1.cpp -o bin/sha1.o
bin/aes.o: src/aes.h src/aes.c
	g++ -c src/aes.c -o bin/aes.o
bin/util.o:src/util.cpp src/util.h
	g++ -c src/util.cpp -o bin/util.o
bin/CmdParser.o: src/CmdParser.h src/CmdParser.cpp
	g++ -c src/CmdParser.cpp -o bin/CmdParser.o
bin/client.o: src/client.h src/client.cpp src/residue_math.h src/aes.h src/util.h src/sha1.h  src/my_exceptions.h
	g++ -c src/client.cpp -o bin/client.o

bin/UnitTest.o:test/UnitTest.h  test/UnitTest.cpp
	g++ -c test/UnitTest.cpp -o bin/UnitTest.o
bin/JacobiTest.o :test/UnitTest.h src/residue_math.h test/JacobiTest.h  test/JacobiTest.cpp 
	g++ -c  test/JacobiTest.cpp -o  bin/JacobiTest.o 
bin/InvTest.o :test/UnitTest.h src/residue_math.h test/InvTest.h  test/InvTest.cpp 
	g++ -c  test/InvTest.cpp -o bin/InvTest.o
bin/EncryptTest.o :test/UnitTest.h src/client.h test/EncryptTest.h test/EncryptTest.cpp 
	g++ -c  test/EncryptTest.cpp -o bin/EncryptTest.o
bin/KeyExtractTest.o : test/KeyExtractTest.h test/KeyExtractTest.cpp src/pkg.h
	g++ -c test/KeyExtractTest.cpp -o bin/KeyExtractTest.o 
bin/CmdTest.o : test/CmdTest.h test/CmdTest.cpp 
	g++ -c test/CmdTest.cpp -o bin/CmdTest.o 
bin/test.o:  test/test.cpp test/UnitTest.h test/JacobiTest.h test/InvTest.h src/residue_math.h
	g++ -c test/test.cpp -o bin/test.o
bin/main.o: src/main.cpp src/pkg.h src/client.h src/sha1.h src/util.h
	g++ -c  src/main.cpp -o bin/main.o

test: bin/UnitTest.o  bin/JacobiTest.o bin/InvTest.o bin/EncryptTest.o bin/KeyExtractTest.o bin/CmdTest.o bin/pkg.o bin/client.o bin/aes.o bin/util.o bin/sha1.o bin/residue_math.o  bin/CmdParser.o bin/test.o
	g++ bin/test.o bin/UnitTest.o bin/JacobiTest.o bin/InvTest.o bin/EncryptTest.o bin/KeyExtractTest.o bin/CmdTest.o bin/pkg.o bin/client.o bin/aes.o bin/util.o bin/sha1.o bin/residue_math.o bin/CmdParser.o  -l ntl -o bin/test
bin/program: bin/pkg.o bin/residue_math.o bin/sha1.o bin/util.o bin/aes.o  bin/CmdParser.o bin/client.o bin/main.o 
	g++ bin/main.o bin/client.o bin/pkg.o bin/residue_math.o bin/sha1.o bin/aes.o bin/util.o bin/CmdParser.o -l ntl  -o bin/program
clean:
	rm -f bin/*
